package com.zhihuichongcheng.application.util;

/**
 * Created by LK on 2016/3/25.
 */
public class StringUtils {
    public static boolean isEmpty(String str) {
        return null == str || str.trim().equals("") || str.trim().equals("null");
    }

    /**
     * 首字母转小写
     *
     * @param s 数据源
     * @return 结果
     */
    public static String toLowerCaseFirstOne(String s) {
        if (Character.isLowerCase(s.charAt(0)))
            return s;
        else
            return (new StringBuilder()).append(Character.toLowerCase(s.charAt(0))).append(s.substring(1)).toString();
    }


    /**
     * 首字母转大写
     *
     * @param s 数据源
     * @return 结果
     */
    public static String toUpperCaseFirstOne(String s) {
        if (Character.isUpperCase(s.charAt(0)))
            return s;
        else
            return (new StringBuilder()).append(Character.toUpperCase(s.charAt(0))).append(s.substring(1)).toString();
    }
}
